<template>
  <div class="searchbottom">
    <div v-for="s in searchList.goodsList" :key='s.id' @click='goDetail(s.id)'>
      <a>
        <img :src="s.defaultImg" alt="" />
        <span>¥{{s.price}}.00</span><br />
        <a>{{s.title}}</a>
        <p>已有<span>2000</span>人评价</p>
      </a>
      <div class="bottom">
        <a href="">加入购物车</a>
        <a href="">收藏</a>
      </div>
    </div>

  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  computed: {
    ...mapState('searchAbout', ['searchList'])
  },
  methods: {
    goDetail (id) {
      this.$router.push({
        name: 'detail',
        params: {
          id: id
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
.searchbottom {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  & > div {
    width: 20%;
    height: 400px;
    margin-right: 5%;
    & > a {
      img {
        width: 100%;
        height: 250px;
      }
      & > span {
        color: #c81623;
        font-size: 25px;
      }
      a {
        display: block;
        height: 36px;
        overflow: hidden;
        font-style: normal;
        font-size: 13px;
        line-height: 20px;
      }
      p {
        font-size: 13px;
        span {
          color: skyblue;
          font-weight: bold;
          font-size: 15px;
        }
      }
    }
    .bottom{
      display: flex;
      height: 28px;
      justify-content: space-between;
      a{
        border: 1px solid #8c8c8c;
        color: #8c8c8c;
        width: 110px;
        line-height: 28px;
        text-align: center;
      }
    }
  }
}
</style>
